////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//		File Name		:		CTestingLevelState.h
//
//		Author			:		Kevin Jordan
//
//		Purpose			:		A header for all functions and members of the Testing State
//
//		Dates			:		Written( March 2, 2011 ) by Kevin Jordan		LastUpdate( March 2, 2011  ) by Kevin Jordan 
//	
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef CTESTINGLEVELSTAT_H_
#define CTESTINGLEVELSTAT_H_
#include "IBaseState.h"
#include "CPlayer.h"
#include "VIN_EventSystem.h"
#include "CEmitter.h"
#include "CPlayerProfile.h"
#include "CEnemy.h"
#include "CPlatform.h"
#include "CMeleeEnemy.h"
#include "IListener.h"
#include "CJCEvent.h"
#include <vector>
using std::vector;

struct WaveInfo
{
	float fWaveTime;
	int NumOfEnemies;
};


class CTestingLevelState : public IBaseState, public IListener
{

private:

	CJCEvent m_JCE;

	CTestingLevelState(const CTestingLevelState& copy);
	CTestingLevelState& operator=(const CTestingLevelState& assign);
	CTestingLevelState();
	~CTestingLevelState();

	CMeleeEnemy* pEnemy;
	CMeleeEnemy* enemy_ME;
	CEmitter* pEmitter;
	vector<WaveInfo> m_vWaves;

	CPlayerProfile ActiveProfile;
	

	

	///////////////////////////////////////////////
	//Details of the Level
	//How many Enemies, How many are dead
	///////////////////////////////////////////////
	int ImageID;
	bool BombToggle;
	bool Blam;
	int m_nNumOfEnemies;
	int m_nMaxEnemies;
	int m_nNumOfDeadEnemies;
	int m_nPrevCount;
	int WaveCount;
	int RoundCount;
	bool SaveBeforeExit;
	float fBucketTE;
	float m_fWaveTime;
	bool m_bNoTimeUpdate;
	float blambucket;
	float fEnemySpawnBucket;
	bool m_bInShop;
	int m_nShopSelection;
	bool m_bRoundComplete;
	int m_nShopImage[8];
	int m_nRoundCount;
	bool m_bWaveOver;
	float m_fEndOfWaveBucket;
	CMeleeEnemy* TemplateEnemy;	
	void ResetRound();



public:

	static CTestingLevelState* GetInstance();	
	void Render();
	bool Input();
	void Update(float fElapsedTIme);
	void Exit();
	void Enter();

	int GetDeadEnemies()		{ return m_nNumOfDeadEnemies; }
	int GetMaxEnemies()			{ return m_nMaxEnemies; }
	int GetNumOfDeadEnemies()	{ return m_nNumOfDeadEnemies; }
	int GetWaveCount()			{ return WaveCount; }
	float GetWaveTime()			{ return m_fWaveTime;}
	bool GetInShop()			{ return m_bInShop; }
	int GetRoundCount()			{ return m_nRoundCount; }

	void SetDeadEnemies( int newEnemyCount )	{ m_nNumOfDeadEnemies = newEnemyCount;	}
	void SetMaxEnemies( int newMaxEnemies	)	{ m_nMaxEnemies = newMaxEnemies; }
	void SetInShop()		{m_bInShop = !m_bInShop; }
	void SetRoundComplete()		{m_bRoundComplete = !m_bRoundComplete; }
	

	void IncrementDead()	{m_nNumOfDeadEnemies++;}

	void HandleEvent(CEvent* pEvent);

	void SpawnEnemies();
	void WaveSet();
	void InitWaves();
	bool GetTogg() { return BombToggle; }
};
#endif